package com.lxm.shownews.channel;

/**
 * Created by lxm on 2016/2/24.
 */
public enum NewsType {
    NoneImg(0), OneImg(1), DoubleImg(2), TreeImg(3), MoreImg(4);

    private int type;

    private NewsType(int type) {
        this.type = type;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public static int getValue(NewsType newsType) {
        return newsType.type;
    }

    public static NewsType getType(int type) {
        switch (type) {
            case 0:
                return NoneImg;
            case 1:
                return OneImg;
            case 2:
                return DoubleImg;
            case 3:
                return TreeImg;
            case 4:
                return MoreImg;
            default:
                return NoneImg;
        }
    }
}
